<?php

namespace JLPay\Models\Ledger\Merchconf;

use JLPay\Models\BaseResponse;

/**
 * 商户分账绑定查询响应
 */
class MerchRevBindQueryResponse extends BaseResponse
{
    protected ?string $bindingStatus = null;  // 绑定状态
    protected ?string $failedReason = null;   // 失败原因

    /**
     * 构造函数
     *
     * @param array|null $responseArray
     */
    public function __construct(?array $responseArray = null)
    {
        parent::__construct($responseArray);

        if ($responseArray) {
            $this->bindingStatus = $responseArray['binding_status'] ?? null;
            $this->failedReason = $responseArray['failed_reason'] ?? null;
        }
    }

    /**
     * 获取绑定状态
     *
     * @return string|null
     */
    public function getBindingStatus(): ?string
    {
        return $this->bindingStatus;
    }

    /**
     * 获取失败原因
     *
     * @return string|null
     */
    public function getFailedReason(): ?string
    {
        return $this->failedReason;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        $data['binding_status'] = $this->bindingStatus;
        $data['failed_reason'] = $this->failedReason;
        return $data;
    }
} 